package com.learning.datastruct.collection.queue;

import com.learning.datastruct.collection.list.MyLinkedList;
import com.learning.datastruct.collection.list.MyList;

/**
 * @author ZLH
 */
public class MyQueue<E> {
    private MyList<E> list = new MyLinkedList<>();

    public int size() {
        return list.size();
    }

    public boolean isEmpty() {
        return list.isEmpty();
    }

    public void clear() {
        list.clear();
    }

    public void offer(E element) {
        list.add(element);
    }

    public E poll() {
        return list.remove(0);
    }

    public E peek() {
        return list.get(0);
    }
}
